import { request } from '@/utils/request.js'

/**
 * 财务流水 API JS
 */

export default {

  /**
   * 获取财务流水分页列表
   * @returns
   */
  getList (params = {}) {
    return request({
      url: 'finance/financialStatement/index',
      method: 'get',
      params
    })
  },

  /**
   * 添加财务流水
   * @returns
   */
  save (data = {}) {
    return request({
      url: 'finance/financialStatement/save',
      method: 'post',
      data
    })
  },

  /**
   * 更新财务流水数据
   * @returns
   */
  update (id, data = {}) {
    return request({
      url: 'finance/financialStatement/update/' + id,
      method: 'put',
      data
    })
  },

  /**
   * 读取财务流水
   * @returns
   */
  read (id) {
    return request({
      url: 'finance/financialStatement/read/' + id,
      method: 'get',
      data
    })
  },

  /**
   * 将财务流水删除，有软删除则移动到回收站
   * @returns
   */
  deletes (data) {
    return request({
      url: 'finance/financialStatement/delete',
      method: 'delete',
      data
    })
  },

  /**
   * 从回收站获取财务流水数据列表
   * @returns
   */
  getRecycleList (params = {}) {
    return request({
      url: 'finance/financialStatement/recycle',
      method: 'get',
      params
    })
  },

  /**
   * 恢复财务流水数据
   * @returns
   */
  recoverys (data) {
    return request({
      url: 'finance/financialStatement/recovery',
      method: 'put',
      data
    })
  },

  /**
   * 真实删除财务流水
   * @returns
   */
  realDeletes (data) {
    return request({
      url: 'finance/financialStatement/realDelete',
      method: 'delete',
      data
    })
  },

  /**
   * 更改财务流水数据
   * @returns
   */
  changeStatus (data = {}) {
    return request({
      url: 'finance/financialStatement/changeStatus',
      method: 'put',
      data
    })
  },

  /**
    * 财务流水导入
    * @returns
    */
  importExcel (data = {}) {
    return request({
      url: 'finance/financialStatement/import',
      method: 'post',
      data
    })
  },

  /**
   * 财务流水下载模板
   * @returns
   */
  downloadTemplate () {
    return request({
      url: 'finance/financialStatement/downloadTemplate',
      method: 'post',
      responseType: 'blob'
    })
  },

  /**
   * 财务流水导出
   * @returns
   */
  exportExcel (params = {}) {
    return request({
      url: 'finance/financialStatement/export',
      method: 'post',
      responseType: 'blob',
      params
    })
  },
    /**
   * 通过审计
   * @returns
   */
    auditPass (data = {}) {
      return request({
        url: 'finance/financialStatement/audit/pass',
        method: 'post',
        data
      })
    },
    /**
     * 反审计
     * @returns
     */
    auditRefuse (data = {}) {
      return request({
        url: 'finance/financialStatement/audit/refuse',
        method: 'post',
        data
      })
    },


}